package cate.game.role.farm.island.cell;

import cate.game.GameBody;
import cate.game.play.param.HpExtend;
import cate.game.play.proce.play.PlayPO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import easy.java.dev.note.NoteClass;
import easy.java.dev.note.NoteField;


@NoteClass(value = "守卫格子")
public class FightSideCell extends IslandCell {

    public FightSideCell() {}

    @NoteField(value = "守卫ID", detail = "对应于迷失神庙守卫分组里的ID")
    public int guardId;

    @NoteField(value = "守卫分组ID")
    public int guardGroupId;

    @NoteField("守卫1等级")
    public int guardLevel;

    @NoteField("守卫2等级")
    public int guardTwoLevel;

    @NoteField("1队战力")
    public long power;

    @NoteField("2队战力")
    public long powerTwo;

    @NoteField(value = "血量继承")
    @JsonIgnore
    public HpExtend hpExtend = new HpExtend();

    @NoteField(value = "战斗胜利的次数")
    public byte winTimes;


    @Override
    public void initialize(GameBody gameBody) {
        super.initialize(gameBody);
        if (hpExtend == null) {
            hpExtend = new HpExtend();
        }
    }

    public FightSideCell(byte type) {
        this.type = type;
    }

    // 挑战失败后记录血量
    public void record(PlayPO play) {
        hpExtend.recordByTid(play.teamEnd.b);
    }

    @Override
    public String toString() {
        return super.toString() + "守卫格子";
    }

    public void win(PlayPO play){
        winTimes += 1;
    }
}
